package Demo1;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
//        String[] array = {"hello","world","the","is","haha"};
//        //sort函数只要实现了comparable接口都可以进行排序
//        Arrays.sort(array);
//        System.out.println(Arrays.toString(array));

//        Animal animal = new Dog("coco",2,"black");
//        animal.eat();

        Animal[] animal = {new Dog(), new Cat(), new Bird()};
        //使用多态进行遍历输出
        for(Animal ret : animal){
            ret.eat();
        }
    }
}
